<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 * Description of Exposure_orderModel
 *
 * @author wml
 */

namespace Home\Model;

use Think\Model;

class UserModel extends Model {
    /* 自动验证规则 */

    protected $_validate = array(
    );

    /*
     * 验证用户名和邮箱是否匹配
     *  @author  csb
     */

    public function checkUserEmail($username = "", $email = "") {
        $arr = array();
        if ($username != '') {
            $arr['username'] = $username;
        }
        if ($email != '') {
            $arr['email'] = $email;
        }
        $relust = $this->where($arr)->getField('password');
        return $relust;
    }
    /*
     *  验证用户名和邮箱是否匹配
     *  @author  csb
     */
    public function setPass($username,$pass) {
        return $this->where(array("username"=>$username))->save(array("password"=>$pass));
    }
}

?>
